#!/bin/bash

TARGET_NAME=/data/nginx/html/basic-business
DIRECTORY_NAME=/root/basic-business_web_bak/
#判断目录是否存在
if [ -d "$TARGET_NAME" ];then
  current_time=`date "+%Y-%m-%d_%H:%M:%S"`
  dir_date=$DIRECTORY_NAME$current_time
  mkdir -p $dir_date
  mv $TARGET_NAME $dir_date
  echo "backup to $dir_date"
fi
